//
//  STDSGLFunctions.hpp
//  STDRenderSDK
//
//  Created by 陈学明 on 2023/3/12.
//

#ifndef STDSGLFunctions_hpp
#define STDSGLFunctions_hpp

#include <stdio.h>
#include "STDSOpenGL.h"

class STDSGLFunctions {
public:
    static GLuint createTexture();

    static GLuint createTexture(int _w, int _h, GXNS_GL(GLenum) _f = GXNS_GL(GL_RGBA));

    static GLuint createTexture(void *_data, int _w, int _h);

    static void resetTextureFilter(unsigned int _tid, GXNS_GL(GLenum) _fmin, GXNS_GL(GLenum) _fmag);

    static void resetTextureWrap(unsigned int _tid, GXNS_GL(GLenum) _wrapS, GXNS_GL(GLenum) _wrapT);

    static bool checkGlError(const char *op);
    
    static void draw_ELE_POINTS(void *idx, int count, int start = 0);

    static void draw_ARR_POINTS(void *idx, int count, int start = 0);

    static void draw_ELE_TRI_STRIP(void *idx, int count, int start = 0);

    static void draw_ARR_TRI_STRIP(void *idx, int count, int start = 0);

    static void draw_ELE_TRIANGLES(void *idx, int count, int start = 0);

    static void draw_ARR_TRIANGLES(void *idx, int count, int start = 0);

    static void draw_ELE_LINES(void *idx, int count, int start = 0);

    static void draw_ARR_LINES(void *idx, int count, int start = 0);

    static void draw_ELE_TRIFAN(void *idx, int count, int start = 0);

    static void draw_ARR_TRIFAN(void *idx, int count, int start = 0);
};
#endif /* GLFunctions_hpp */
